package com.aisile.crowd_funding.common.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @标题 ErrorHandler
 * @作者 Mr.chen
 * @创建日期 2018/12/5 11:48
 * @版本号 1.0
 **/
// 这个东西  controller增强注解
// 当controller报异常时   可以在此类中捕获     Exception    NullPointException  ClassCastException
@ControllerAdvice
public class ErrorHandler {
    @ExceptionHandler(value = NullPointerException.class)
    public void NullPointerException(HttpServletRequest request, HttpServletResponse response){

    }
    @ExceptionHandler(value = ClassCastException.class)
    public void ClassCastException(){

    }
    @ExceptionHandler(value = Exception.class)
    public void exceptionHandler(){

    }
}
